<%= render :partial => 'left_bar', :locals => { :on => 4 } -%>

<% content_for :extra do -%>
  <a class="btt bttr" id="import">导入</a>
<% end -%>

<div id="main">
  <%= render :partial => 'shared/menu_bar', :locals => { :new_entry_link => new_dictionary_path } -%>
  
  <div class="box">
    <% form_for :dictionary, :url => import_dictionaries_path, :html => { :multipart => true, :id => 'import_dictionary' } do |f| -%>
    <table class="table border">
      <tr class="th">
        <td width="80" align="right"><strong>导入txt文件</strong></td>
        <td><%= file_field_tag :import_file %></td>
      </tr>
      <tr class="tr2">
        <td width="80" align="right"><strong>垃圾词库</strong></td>
        <td><%= check_box_tag :flag, 1 %></td>
      </tr>
    </table>
    <% end -%>
  </div>
</div>

<script>
$( function() {
  $('#main .border:first a:lt(2)').remove();
  
  $('#import').live('click', function() {
    $('form#import_dictionary').submit();
  });
})
</script>
